﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Carbon.Web.Forms.Controls;

namespace Demo.Demos
{
    public class PopupOpenerLink : PopupOpener<Object>
    {
        private String m_Text = default(String);
        public String Text
        {
            get
            {
                return m_Text;
            }
            set
            {
                m_Text = value;
            }
        } 

        public override void RenderControl(System.Web.UI.HtmlTextWriter writer)
        {
            base.RenderControl(writer);
            writer.Write("<a href=\"#\" id=\"{1}\" onclick=\"javascript:{0} return false;\" class=\"btn btn-mini\" >", GetOpenPopupJavascript(), this.ClientID);
            String text = Text;
            if (text == null)
                text = string.Empty;
            writer.WriteEncodedText(text);
            writer.Write("</a>");
        }
    }
}